import { decompress } from '@src/assets/js/tool'
import { Space } from 'antd'
import React from 'react'

export function getColumns (common, structureMap, setVisible, setModifyData, refreshFn) {
  return [
    {
      title: '序号',
      dataIndex: 'index',
      key: 'index',
      align: 'center',
      width: '60px'
    },
    {
      title: '姓名',
      dataIndex: 'name',
      key: 'name',
      width: 100
    },
    {
      title: '类型',
      dataIndex: 'type',
      key: 'type',
      width: 100
    },
    {
      title: '性别',
      dataIndex: 'gender',
      key: 'gender',
      width: 100
    },
    {
      title: '手机号',
      dataIndex: 'mobile',
      key: 'mobile',
      width: 100,
      render: (v) => {
        if (v) {
          return decompress(v)
        }
      }
    },
    {
      title: '操作',
      dataIndex: 'index',
      key: 'operate',
      width: 60,
      render: (value, line) => {
        return (
          <Space size='middle'>
            <a onClick={() => { common.addWindow({ id: `InstitutionPersonCaseStat${line.id}`, title: `人员工作量趋势-${line.name}`, componentName: 'InstitutionPersonCaseStat', meta: { id: line.id, tenant_code: line.tenant_code, name: line.name } }) }}>人员工作量趋势</a>
          </Space>
        )
      }
    }
  ]
}
